package com.stx.base.thread;

public class MyRunnable implements Runnable{
	
	
	@Override
	public void run() {
		for(int i = 0; i < 50; i++){
			int mod = (int)(100*Math.random())%2;
			int money = (int)(10*Math.random());
			if(mod == 0){
				BankCrashEx.getInstance().addMoney(money);
			}else{
				BankCrashEx.getInstance().subMoney(money);
			}
			try {
				Thread.sleep(2000);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
		System.out.print("threadId: " + Thread.currentThread().getName() + " exit...");
	}
	
}
